package com.ruoyi.eqmonitor.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.eqmonitor.domain.OptDeviceMonitorAnalyseData;
import com.ruoyi.eqmonitor.domain.OptDeviceMonitorLastData;
import com.ruoyi.eqmonitor.utils.Constant;

import java.util.Date;
import java.util.List;
import java.util.concurrent.Future;

/**
 * @author ruoyi
 * @date 2022-11-25
 */
public interface IOptDeviceMonitorAnalyseDataService extends IService<OptDeviceMonitorAnalyseData>{

    /**
     * 根据设备编码查询当前设备的最新分析数据
     * @param deviceCode 设备编码
     * @return
     */
    List<OptDeviceMonitorAnalyseData> selectLastDataByDeviceCode(String deviceCode);

    /**
     * 查询所有最新的设备分析数据
     */
    List<OptDeviceMonitorAnalyseData> selectLastDataList();

    /**
     * 获取统计分析的原有监测指标
     * @param monitorInfo 统计分析的监测指标
     * @return 分析的监测指标
     */
    public Constant.MonitorInfo getTargetMonitorInfo(Constant.MonitorInfo monitorInfo);

    /**
     * 定时任务调用 执行所有设备的日均值分析
     */
    public void analyseDailyAccumulation(Date date, boolean needAlarm);

    public Future<Boolean> analyseCumulativeDischarge(Date startTime, Date endTime);

    public Future<Boolean> analyse24HourRain(Date startTime, Date endTime);

    public Future<Boolean> analyseAvgOther(Date startTime, Date endTime, Constant.MonitorInfo monitorInfo);

    public List<OptDeviceMonitorLastData> flushLastMonitorData();
}
